package cn.wolfcode.cotroller;

import cn.wolfcode.Utlis.oSSUtlis;
import cn.wolfcode.domain.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

//oss上传文件
@RestController
@Slf4j
public class ossUpload {
    @Autowired
    private oSSUtlis oSSUtlis;
    @PostMapping("/upload")
    public Result upload(MultipartFile image) throws IOException {
        log.info("开始上传文件", image);
        return Result.success(oSSUtlis.upload(image));
    }

}
